package com.atguigu.java2;

public class DaySixTest {

		public static void main(String[] args) {
			
				Circle c = new Circle();
				PassObject a = new PassObject();
				a.printAreas(c, 9);
				System.out.println(" "+ "now radius is:" + (c.radius+1));
		}
}


class Circle{
		//此类用radius输入半径，用findArea（）返回圆的面积
		
		//圆的半径
		double radius;
		
		//返回圆的半径
		public double findArea(){
//				double s = Math.PI * radius * radius;
//				return s;
				return Math.PI * radius * radius;
		}

}

class PassObject{
		
		public void printAreas(Circle c, int time){
				System.out.println("Radius" + "   " + "   " + "Area");
				for(int i = 1; i <  time + 1; i++){
						c.radius = i;
						//double s = c.findArea();
						System.out.println(c.radius + "   " + "       " + c.findArea());
				}
				//System.out.println(" "+ "now radius is:" + c.radius);
		}
	
}
